﻿<view:UCModule x:Class="UCOLOR.View.DirView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"          
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
    xmlns:dxdb="clr-namespace:UColor.WPF"
    xmlns:helpers="clr-namespace:UCOLOR.Helpers"
    xmlns:local="clr-namespace:UCOLOR.App.Extend"
    xmlns:view="clr-namespace:UColor.WPF"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="1118" FontWeight="Bold" Focusable="True">
    <view:UCModule.Resources>
        <helpers:StringFormatConverter x:Key="StringFormatConverter" />
        <helpers:ImageSourceConverter x:Key="ImageSourceConverter" />

        <Style x:Key="DefaultStyle" TargetType="{x:Type Button}">
            <Setter Property="Height" Value="25" />
            <Setter Property="Padding" Value="5,10,5,10" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="LayoutRoot" RenderTransformOrigin="0.5,0.5">
                            <Rectangle x:Name="Background"
                                Fill="{TemplateBinding Background}" />
                            <Rectangle x:Name="BackgroundGradient"
                               
                                StrokeThickness="0" Margin="0" RadiusX="15" RadiusY="15">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1,1">

                                        <GradientStop Color="Transparent" Offset="0.7" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                              Grid.RowSpan="2" 
                                              RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="VerticalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Small" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalTile" TargetType="dxlc:Tile">
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Size" Value="Large" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate />
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="14" Margin="20,0,0,0" VerticalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="FlatTile" TargetType="dxlc:Tile">
            <Setter Property="Size" Value="Large" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel>
                            <Image Source="{Binding}" Stretch="None" />
                            <TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType=dxlc:Tile}}" FontSize="24" Margin="0,5,0,0" HorizontalAlignment="Center" />
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ModuleLinkButton" TargetType="Button">
            <Setter Property="Focusable" Value="False" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="SteelBlue" Cursor="Hand">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0" To="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0:0:0.15" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TextBlock" />
                                            </Storyboard>
                                        </VisualTransition>
                                        <VisualTransition From="MouseOver" GeneratedDuration="0">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0:0:0.3" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TextBlock" />
                                            </Storyboard>
                                        </VisualTransition>
                                        <VisualTransition From="Disabled" GeneratedDuration="0">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0:0:0.2" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TextBlock" />
                                            </Storyboard>
                                        </VisualTransition>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Disabled" >
                                        <Storyboard>
                                            <DoubleAnimation To="1.0" Duration="0:0:0.5" Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="(UIElement.Opacity)"/>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="Foreground">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush>#000</SolidColorBrush>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver" >
                                        <Storyboard>
                                            <DoubleAnimation To="1.0" Duration="0:0:0.15" Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="(UIElement.Opacity)"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <TextBlock x:Name="TextBlock" Text="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="#000" FontSize="14" Opacity="0.5" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </view:UCModule.Resources>
  <dxdb:DemoModuleControl>
    <DockPanel LastChildFill="True">
        <Grid DockPanel.Dock="Top" Name="ProductNav" Background="#FFFFFFFF">
            <Grid x:Name="LayoutRoot" Width="auto" Height="auto">
                <Grid.RowDefinitions>
                    <RowDefinition  />
                    <RowDefinition  />
                    <RowDefinition  />
                </Grid.RowDefinitions>
                <Grid Grid.Column="1" Name="Nav" Grid.Row="0" Margin="0,0" VerticalAlignment="Top"  Background="#E6499F9F">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="98" />
                        <ColumnDefinition Width="*" MaxWidth="5" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" MaxWidth="30" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" MaxWidth="30" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" MaxWidth="30" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" MaxWidth="30" />
                    </Grid.ColumnDefinitions>
                </Grid>          
            </Grid>
        </Grid>
        <Popup Name="ModalDialog" StaysOpen="True"  Placement="MousePoint" Margin="200,400,0,0">
            <Border BorderThickness="2" BorderBrush="SteelBlue" Width="600" Height="250">
                <Grid Background="White">
                    <DockPanel Height="28" VerticalAlignment="Top" Background="SteelBlue">
                        <TextBox Height="26" Name="TxtBoxTitle" Width="120" Background="SteelBlue" BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White" FontSize="16" Focusable="False" IsHitTestVisible="False" IsTabStop="False" VerticalContentAlignment="Center">搜索</TextBox>
                        <Button Height="26" Name="BtnClose" Width="26" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="16" Background="SteelBlue" Click="Dlg_BtnClose_Click" Style="{StaticResource ModuleLinkButton}">X</Button>
                    </DockPanel>
                    <Grid Margin="0,30,0,0" Height="214">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="126" />
                            <ColumnDefinition Width="126" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="29" />
                            <RowDefinition Height="29" />
                            <RowDefinition Height="29" />
                            <RowDefinition Height="29" />
                            <RowDefinition Height="29" />
                            <RowDefinition Height="29" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Button Margin="0,12,170,6" Height="22" Width="68" HorizontalAlignment="Right" Click="Dlg_BtnOK_Click" Style="{StaticResource ModuleLinkButton}" Grid.Row="6" Grid.Column="2">确定</Button>
                        <Button Margin="0,12,57,6" Height="22" Width="68" HorizontalAlignment="Right" Click="Dlg_BtnClose_Click" Style="{StaticResource ModuleLinkButton}" Grid.Row="6" Grid.Column="2">取消</Button>
                        <Label Content="尺  寸" Grid.RowSpan="2" Height="28" HorizontalAlignment="Left" Margin="10,6,0,0" Name="label1" VerticalAlignment="Top" />
                        <Label Content="封面材质" Grid.Row="1" Height="28" HorizontalAlignment="Left" Margin="10,1,0,0" Name="label2" VerticalAlignment="Top" />
                        <Label Content="内页材质" Grid.Row="2" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label3" VerticalAlignment="Top" />
                        <Label Content="内页内心" Grid.Row="3" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label4" VerticalAlignment="Top" />
                        <Label Content="内页页数" Grid.Row="4" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label5" VerticalAlignment="Top" />
                        <Label Content="内页工艺" Grid.Row="5" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0" Name="label6" VerticalAlignment="Top" />
                    </Grid>
                </Grid>
            </Border>
        </Popup>
       <Grid Name="Center" Background="#FFFFFFFF">
       </Grid>
    </DockPanel>
 </dxdb:DemoModuleControl>
</view:UCModule>
